package com.neusoft.movie.v_movies.fragment;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.neusoft.movie.v_movies.R;
import com.neusoft.movie.v_movies.adpater.ArticlesAdapter;
import com.neusoft.movie.v_movies.javabean.ArticlesBean;
import com.neusoft.movie.v_movies.listener.RetrofitListener;
import com.neusoft.movie.v_movies.model.UsersModel;
import java.util.List;

/**
 * Created by Administrator on 2018/3/15.
 */

public class MyColArtFragment extends BaseFragment implements RetrofitListener<List<ArticlesBean>> {
        private RecyclerView recyclerView;
        private int u_id;

@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,@Nullable Bundle savedInstanceState) {
        setLayout_file(R.layout.fragment_my_col_art);
        return super.onCreateView(inflater, container, savedInstanceState);
        }

    @Override
    void initEvents() {

            }

    @Override
    void initViews() {
           recyclerView = (RecyclerView)view.findViewById(R.id.rV_myart);
           recyclerView.setLayoutManager(new LinearLayoutManager(this.getActivity()));

    }

   @Override
    void initData() {
      UsersModel usersModel = new UsersModel();
      usersModel.mycolart(getUser_id(),1,this);

    }


   @Override
   public void onSuccess(List<ArticlesBean> articlesBeen, int flag) {
        ArticlesAdapter adapter = new ArticlesAdapter(getActivity(),articlesBeen);
        recyclerView.setAdapter(adapter);

   }



    @Override
    public void onFailed() {
    }

}


